import request from '@/utils/request.js'

// 常量
const api_name = '/system/admin/menu'

export default {
    getMenuTree() {
        return request({
            url: `${api_name}/getMenuTree`,
            method: 'get'
        })
    },
    getMenuDetailsById(id) {
        return request({
            url: `${api_name}/getMenuDetailsById/${id}`,
            method: 'get'
        })
    },
    saveMenu(data) {
        return request({
            url: `${api_name}/saveMenu`,
            method: 'post',
            data: data
        })
    },
    updateMenu(data) {
        return request({
            url: `${api_name}/updateMenu`,
            method: 'post',
            data: data
        })
    },
    deleteById(id) {
        return request({
            url: `${api_name}/deleteById/${id}`,
            method: 'post'
        })
    },
}
